//
//  LoginViewController.m
//  StationManager
//
//  Created by Helong on 17/3/3.
//  Copyright © 2017年 Helong. All rights reserved.
//

#import "LoginViewController.h"
#import "LoginView.h"

@interface LoginViewController ()

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *imageView = [[UIImageView alloc]init];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.equalTo(self);
    }];
    [imageView setImage:[UIImage imageNamed:@"login_bg"]];
    //登录视图
    LoginView *loginView = [[LoginView alloc]init];
    [self.view addSubview:loginView];
    loginView.backgroundColor = [UIColor whiteColor];
    [loginView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.height.equalTo(self.view).dividedBy(2.1);
        make.width.equalTo(self.view).multipliedBy(0.7);
    }];
  //标题
    UILabel *titleLabel = [[UILabel alloc]init];
    [self.view addSubview:titleLabel];
    [titleLabel setBackgroundColor:RGBCOLOR(54, 124, 207)];
    [titleLabel setText:@"气象台站运维系统登录"];
    [titleLabel setTextColor:[UIColor whiteColor]];
    [titleLabel setFont:[UIFont systemFontOfSize:18]];
    [titleLabel setTextAlignment:NSTextAlignmentCenter];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(loginView.mas_left).offset(- 20*wl);
        make.top.equalTo(loginView).offset(30*hl);
        make.width.equalTo(loginView).multipliedBy(0.85);
        make.height.mas_equalTo(55*hl);
    }];
    //黑背影
    UIImageView *imgView = [[UIImageView alloc]init];
    [self.view addSubview:imgView];
    imgView.backgroundColor = [UIColor clearColor];
    [imgView setImage:[UIImage imageNamed:@"corner"]];
    [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(loginView.mas_left);
        make.top.equalTo(titleLabel.mas_bottom);
        make.left.equalTo(titleLabel);
        make.height.mas_equalTo(15*hl);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
